﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace VueAdminService.DTO
{
	[SugarTable("Dict")]
	public class DictDTO
	{
		/// <summary>
		/// 主键
		/// </summary>
		[SugarColumn(IsPrimaryKey = true)]
		public string DictId { get; set; }
		/// <summary>
		/// 字典代码
		/// </summary>
		public string Code { get; set; }
		/// <summary>
		/// 字典名
		/// </summary>
		public string Name { get; set; }
		/// <summary>
		/// 父级Id,-1代表一级字典
		/// </summary>
		public string? ParentId { get; set; }		
		/// <summary>
		/// 备注
		/// </summary>
		public string? Bak { get; set; }
		/// <summary>
		/// 子数据字典
		/// </summary>
		[SugarColumn(IsIgnore = true)]
		public List<DictDTO> Children { get; set; }=new List<DictDTO>();
		/// <summary>
		/// 是否有子数据字典
		/// </summary>
		[SugarColumn(IsIgnore = true)]
		public bool HasChildren { get { return Children.Count>0; } }
		
	}
}
